<%-- 
    Document   : welcome
    Created on : 2020-6-15, 20:24:19
    Author     : 阿椋世界第二可爱
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link rel="stylesheet" href="welcome.css" type="text/css">
        <title>恭喜你！登陆成功</title>
    </head>
    <body>
    <div id="welcome">  
        <h1>welcome</h1>  
    </div>                            
         <div id="counter">        
        <jsp:useBean id="counter" scope="application" class="myservlet.Counter"/>
         当前页面访问次数：
         <jsp:getProperty name="counter" property="count"/>
         </div>
         
         <div id="calculater">
             <h2>超简易并不精确计算器</h2>
             <div id="display">
                 <p>
                     <jsp:useBean id="calculator" scope="page" class="myservlet.Calculator"></jsp:useBean>
                    <jsp:setProperty property="*" name="calculator" />
                    <% 
                   calculator.calculator();
                    %>
                   计算结果：
		     <jsp:getProperty property="firstNum" name="calculator"/>
		     <jsp:getProperty property="operator" name="calculator"/>
		     <jsp:getProperty property="secondNum" name="calculator"/>
		     =
		     <jsp:getProperty property="result" name="calculator"/>
                 </p>
             </div> 
             <form action="welcome.jsp" method="post">
			<table id="calArea">
				<tr>
					<td><div id="word">第一个数:</div></td>
					<td><input type="text" name="firstNum" id="editText"></td>
				</tr>
				<tr><td> </td></tr>
				<tr>
					<td>
						<select name="operator" id="operator">
							<option value="+">+</option>
							<option value="-">-</option>
							<option value="*">*</option>
							<option value="/">/</option>
						</select>
					</td>
				</tr>
				<tr><td> </td></tr>
				<tr>
					<td><div id="word">第二个数</div></td>
					<td><input type="text" name="secondNum" id="editText" ></td>
				</tr>
				<tr><td> </td></tr>
				<tr>
					<td align="right"><input type="submit" name="put" id="buttom" value="提交"></td>
					<td align="right"><input type="reset" name="clear" id="buttom" value="重置"></td>
				</tr>
			</table>	
		</form>                     
         </div>
                 
                 
    </body>
</html>
